Repository navigation
test(node): Add integration tests for the Neon serverless driver - #25177
Conversation
|
bugbot run |
size-limit report 📦
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3b6fec1. Configure here.
3b6fec1 to
afcf1c8
Compare
JPeer264
left a comment
There was a problem hiding this comment.
LGTM. I still have one question about the DB - maybe I misunderstand something
|
|
||
| neonConfig.fetchEndpoint = 'http://localhost:4494/sql'; | ||
|
|
||
| const sql = neon('postgres://test:test@db.localtest.me:5432/tests'); |
There was a problem hiding this comment.
q: Is port 5432 exported? The docker file says 5496 is the host port 🤔 If it works I wonder if the tests is using the correct db
There was a problem hiding this comment.
The test never connects to that address, the drivers only talk to the proxy on 4494 and the proxy connects to the compose database itself, so the host and port in the scenario only end up in the span attributes.
afcf1c8 to
0fcb995
Compare
Run both Neon drivers against Neon's own proxy in front of a local Postgres, so the HTTP and WebSocket wire protocols are the real ones. Covers queries, tagged templates, batches, failing statements and pool queries in ESM and CJS under the default span lifecycle. ws is needed for the WebSocket driver on Node 20, which has no global WebSocket. Refs #25144 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
0fcb995 to
0ad123a
Compare
Adds `neonIntegration` for `@neondatabase/serverless`. Both drivers emit `db` spans with the pg span shape: the WebSocket `Client`/`Pool` and the HTTP `neon()` function, including Drizzle's `neon-http` and `neon-serverless` adapters. Subscribes to the channels from #25176 and registers the config, so build-time bundler plugins get the same coverage as the runtime hook. - The HTTP span wraps the executor inside `neon()`, not the lazy query promise, so `transaction()` batches get one span instead of one per statement plus one for the batch. - Connection attributes for HTTP come from the connection resolver, which runs inside the query span. The executor itself never sees the connection string. - `db.connection_string` is deprecated and not emitted. End-to-end tests follow in #25177. Stacked on #25176. Fixes #25144 Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>

Runs both Neon drivers end to end against Neon's own proxy (
ghcr.io/timowilhelm/local-neon-http-proxy) in front of a local Postgres, so the HTTP/sqland WebSocket/v2wire protocols are the real ones. Coverssql.query(), tagged templates,transaction()batches, a failing statement and pool queries, in ESM and CJS under the default span lifecycle.The suite is excluded on Bun like the other database suites, since
bun runcannot inject the diagnostics channels; the Bun plugin build does run it. The pool test is Node only, because on Bun and Deno the pool's connect callback runs outside the segment's async context.wsis added because Node 20 has no globalWebSocket.Stacked on #25164.
Refs #25144